<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#areaDiv {
				border: 1px solid black;
				width: 300px;
				height: 50px;
				margin-bottom: 10px;
			}
			
			#showMsg {
				border: 1px solid black;
				width: 300px;
				height: 20px;
			}
		</style>
		
		<script>
			window.onload = function(){
				var areaDiv = document.getElementById("areaDiv");
				var showMsg = document.getElementById("showMsg");
			
				areaDiv.onmousemove = function(event){
					
					event = event || window.event;
					
					var x = event.clientX;
					var y = event.clientY;
					//alert(event);
					
					showMsg.innerHTML = "x = " +x+",y ="+y; 
				};
			};
			
			
			
		</script>
	</head>

	<body>
		<div id="areaDiv"></div>
		<div id="showMsg"></div>
	</body>

</html>